package com.yljk.homedoctor.view.dialog;

import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.yilijk.base.basedialog.BaseDialog;
import com.yilijk.base.basedialog.DialogChain;
import com.yljk.homedoctor.HomeUtils;
import com.yljk.homedoctor.R;
import com.yljk.servicemanager.constants.ReactApi;

/**
 * Created by SHICHENG
 * <p>
 * Time on
 */
public class HealthDialog extends BaseDialog {
    private ImageView healthImg;
    private ImageView healthClose;
    private Context context;
    public HealthDialog(@NonNull Context context) {
        super(context);
        this.context = context;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_health);
        healthImg = (ImageView) findViewById(R.id.health_img);
        healthClose = (ImageView) findViewById(R.id.health_close);

        healthClose.setOnClickListener(v -> {
            dismiss();
        });
        Glide.with(context).load("https://cdn.yilijk.com/images/vbp/doctorimg/new/doctor-home-tips.png").transform(new CenterCrop()).into(healthImg);

        healthImg.setOnClickListener(v -> {
            Bundle bundle = new Bundle();
            bundle.putBoolean("switchFlag",false);
            HomeUtils.push(context, ReactApi.HOME_DOCTORBUNDLE,ReactApi.Home.HealthConsultation);
        });
    }

    @Override
    public void intercept(@NonNull DialogChain chain) {
        super.intercept(chain);
    }





}
